<?php
/**
 * 测试删除公司会员功能
 */

// 模拟请求数据
$testData = [
    'user_id' => 1, // 要删除的会员ID
];

// 模拟POST请求
$url = 'http://localhost:8787/v1/company/remove-member';
$data = json_encode($testData);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Content-Type: application/json',
    'Content-Length: ' . strlen($data),
    // 注意：实际使用时需要添加认证头
    // 'Authorization: Bearer ' . $token
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

echo "HTTP状态码: " . $httpCode . "\n";
echo "响应内容: " . $response . "\n";

// 解析响应
$result = json_decode($response, true);
if ($result) {
    echo "响应解析结果:\n";
    echo "code: " . ($result['code'] ?? 'N/A') . "\n";
    echo "msg: " . ($result['msg'] ?? 'N/A') . "\n";
    echo "data: " . json_encode($result['data'] ?? null, JSON_PRETTY_PRINT) . "\n";
} else {
    echo "响应解析失败\n";
}
?> 